package com.zsrt.utils;
/**
*@author jzh
*@创建时间 2017年4月10日下午8:20:46
*类说明：
*/
public class SortUtil {
	
	public static int getKey(int[] a,int low,int high){
		int key=a[low];
		while(low<high){
			while(low<high&&key<=a[high]){
				high--;
			}
			a[low]=a[high];
			while(low<high&&a[low]<=key){
				low++;
			}
			a[high]=a[low];
		}
		a[low]=key;
		return low;
	}
	
	public static void quickSort(int a[],int low,int high){
		if(low<high){
			int middle=getKey(a,low,high);
			quickSort(a,low,middle-1);
			quickSort(a,middle+1,high);
		}
		
	}	

}
